cpuidle: improve perf for certain workloads
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 16 Jun 2014 09:59:05 +0000 (11:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 16 Jun 2014 09:59:05 +0000 (11:59 +0200)
commit775c681db114672088e506b52c851db7456913f2
treec05ef78c931955b3d02b0a5aa8a128b69d54623d
parentebbb51dc8c1790e5187442a808003298b6796762
cpuidle: improve perf for certain workloads

The existing mechanism of using interrupt frequency as a heuristic does
not work well for certain workloads.  As an example, synchronous dd on a
small block size uses deep C-states because much of the time is spent
doing processing so the interrupt frequency is not too high, but when an
IOP is submitted, the interrupt occurs soon after going idle.  This
causes exit latency to be a significant factor.

To fix this, add a new factor which limits the exit latency to be no
more than 10% of the decaying measured idle time.  This improves
performance for workloads with a medium interrupt frequency but a short
idle duration.

In the workload given previously, throughput improves by 20% with this
patch.

This is not ported from the Linux menu governor since that uses load
average and number of IO wait processes to satisfy latency constraints.
If a process is in IO wait state, it compares the exit latency with the
predicted residency reduced by a factor of 10, which is somewhat similar
to what this patch does.

A side effect of this patch is to correctly limit the maximum idle time
used in the correction factor calculation. Previously data->measured_us
was used, and it was never set.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
xen/arch/x86/acpi/cpuidle_menu.c